<!DOCTYPE html>
<html xmlns:th="http://www.springframework.org/schema/jdbc">
<head>
    <meta charset="utf-8">
    <title>用户--添加</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" th:href="@{/treetable-lay/assets/layui/css/layui.css}">
    <script language=javascript th:src='@{/layuiadmin/layui/layui.js}'></script>
    <script language=javascript th:src='@{/js/jquery-3.4.1.js}'></script>
    <script th:src="@{/js/app.js}"></script>
</head>
<body>

<div class="layui-form" lay-filter="layuiadmin-app-form-list" id="layuiadmin-app-form-list" style="padding: 20px 30px 0 0;">

    
 <div class="layui-form-item">
        <label class="layui-form-label">权限描叙</label>
        <div class="layui-input-inline">
            <input type="text" id="desc" name="desc" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input">
        </div>
    </div>
 <div class="layui-form-item">
        <label class="layui-form-label">权限名</label>
        <div class="layui-input-inline">
            <input type="text" id="name" name="name" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input">
        </div>
    </div>
 <div class="layui-form-item">
        <label class="layui-form-label">权限类</label>
        <div class="layui-input-inline">
            <input type="text" id="pid" name="pid" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input">
        </div>
    </div>
 <div class="layui-form-item">
        <label class="layui-form-label">权限url</label>
        <div class="layui-input-inline">
            <input type="text" id="url" name="url" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input">
        </div>
    </div>

    <div class="layui-form-item layui-hide">
        <input type="button" lay-submit lay-filter="layuiadmin-app-form-submit" id="layuiadmin-app-form-submit" value="确认添加">
        <input type="button" lay-submit lay-filter="layuiadmin-app-form-edit" id="layuiadmin-app-form-edit" value="确认编辑">
    </div>
</div>

<script>

    $(function () {
           //父页面的值,赋值到当前页
          
         $('#desc').val(parent.data.desc);
         $('#name').val(parent.data.name);
         $('#pid').val(parent.data.pid);
         $('#url').val(parent.data.url);
     });


    layui.use(['form'], function () {
        //监听提交
        layui.form.on('submit(layuiadmin-app-form-submit)', function (data) {
            data.field.id = parent.data.id;
            var result = ajaxPost(ADMIN_CONSOLE + "/authorityAdmin/save/2", data.field);
            //重载表格
            parent.layui.table.reload('auth-table');
            var index = parent.layer.getFrameIndex(window.name);
            parent.layer.close(index);
            parent.layer.msg(result);
        });
    });
</script>
</body>
</html>
